<?php
interface InterfaceCache{
	public function set($name,$value);
	public function get($name);
}

class Mysql implements InterfaceCache{
	public function set($name,$value){

	}
	public function get($name){

	}
}

class Redis implements InterfaceCache{
	public function set($name,$value){

	}
	public function get($name){
		
	}
}

class Cache{
	public static function instance(string $driver)
	{
		switch (strtolower($driver)) 
		{
			case 'mysql':
				return new Mysql;
				break;
			
			case 'redis':
				return new Redis;
				break;
		}
	}
}

$cache=Cache::instance("redis");
var_dump($cache->get('name'));

//输出 NULL